<?php
/**
 * Created by PhpStorm.
 * User: mac
 * Date: 16/9/13
 * Time: 下午7:33
 */

namespace app\admin\controller;


use think\Controller;
use think\Db;
use think\Request;
use think\Session;

class System extends Controller
{
    function __construct(Request $request)
    {
        parent::__construct($request);
        if (!Session::get("login")){
            $this->error("请登录","User/login");
        }
    }

    function about(){
        $content = Request::instance()->post('content');
        if ($content){
            Db::name('setting')->where(['name'=>'about'])->update(['value'=>$content]);
        }
        $content = Db::name('setting')->where(['name'=>'about'])->find();
        $this->assign("content",$content['value']);

        return view();
    }

    function aboutSet(){
        return view();
    }
}